package com.yjd.job.service;

import java.util.List;
import java.util.Map;

import com.yjd.comm.base.model.ResultModel;
import com.yjd.comm.base.service.IBaseService;
import com.yjd.job.model.JobModel;

/**
 * job服务
 * 
 * @author ready
 * @date 2014-8-8
 */
public interface IJobService extends IBaseService {
	/**
	 * 新增，type不能重复
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public ResultModel insert(JobModel model) throws Exception;

	/**
	 * 根据文件服务id删除对象
	 * 
	 * @param idJob
	 *            job编号
	 * @return
	 * @throws Exception
	 */
	public boolean delete(Long idJob) throws Exception;

	/**
	 * 根据Map中的参数删除对象
	 * 
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public boolean deleteByMap(Map<Object, Object> paramMap) throws Exception;

	/**
	 * 修改，type不能重复
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public ResultModel update(JobModel model) throws Exception;

	/**
	 * 根据job的类型删除job
	 * 
	 * @param type
	 *            job类型
	 * @return
	 * @throws Exception
	 */
	public JobModel getJobModelByType(String type) throws Exception;
	
	/**
	 * 取得数据库中配置的JOB列表
	 * @return
	 */
	public List<JobModel> queryDefinedJobs() throws Exception;
}
